import ResManager from "../../../core/ResManager";

const {ccclass, property} = cc._decorator;

@ccclass
export default class ItemSkillTip extends cc.Component {

    @property(cc.Label)
    labSkillName: cc.Label = null;

    @property(cc.RichText)
    labSkillInfo: cc.RichText = null;

    init(skillId){
        let config_skill = ResManager.ins().getRes('config_skill');
        let skillInfo = config_skill[skillId]
        if(skillInfo){
            let config_language = ResManager.ins().getRes('config_language');

            this.labSkillName.string = config_language[skillInfo.skillName].text;
            this.labSkillInfo.string = config_language[skillInfo.skillDes].text;
        }
    }

    OnClose(){
        this.node.active = false;
    }
}
